import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:ninetyfour/l10n/app_localizations.dart';

class AccountBottomView extends StatelessWidget {
  final VoidCallback onSelectAll;
  final VoidCallback onDelete;
  final bool isAllSelected;
  final int selectedCount;

  const AccountBottomView({
    Key? key,
    required this.onSelectAll,
    required this.onDelete,
    required this.isAllSelected,
    required this.selectedCount,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      height: 70, 
      padding: EdgeInsets.only(bottom: 0),
      color: Colors.white,
      child: Row(
        children: [
          SizedBox(width: 20.w),
          Checkbox(
            value: isAllSelected,
            onChanged: (value) {
              onSelectAll();
            },
            shape: const CircleBorder(),
          ),
          SizedBox(width: 3),
          GestureDetector(
            onTap: onSelectAll,
            child: Text(
              AppLocalizations.of(context)!.selectAll,
              style: TextStyle(fontSize: 14.sp, color: Colors.black),
            ),
          ),
          const Spacer(),
          if (selectedCount > 0)
            Text(
              '（已选${selectedCount}项）',
              style: TextStyle(
                fontSize: 12.sp,
                color: const Color(0xFFACACAC),
              ),
            ),
          TextButton(
            onPressed: onDelete,
            child: Text(
               AppLocalizations.of(context)!.delete,
              style: TextStyle(
                fontSize: 14.sp,
                color: selectedCount > 0 ? const Color(0xFFF61F03) : (isAllSelected ? const Color(0xFFFF3B30) : const Color(0xFF999999)),
              ),
            ),
          ),
          SizedBox(width: 15.w),
        ],
      ),
    );
  }
}